<template>
  <div class="banner">
      <h3>必逛·好店</h3>
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="(img, index) in imgs" :key="index"
        ><img :src="img"
      /></van-swipe-item>
      <!-- <van-swipe-item><img src="/cimgs/banner1-2.jpg" alt="" /></van-swipe-item>
      <van-swipe-item><img src="/cimgs/banner1-3.jpg" alt="" /></van-swipe-item>
      <van-swipe-item><img src="/cimgs/banner1-4.jpg" alt="" /></van-swipe-item> -->
    </van-swipe>
    <div>
        <h3>品牌·聚焦</h3>
        <img src="/cimgs/4.jpg" alt="">
    </div>
  </div>
</template>

<script>
import Vue from 'vue';
import { Swipe, SwipeItem } from 'vant';
Vue.use(Swipe);
Vue.use(SwipeItem);
import axios from "axios";
export default {
  name: "Banner",
  data() {
    return {
      imgs: [],
    };
  },
  created() {
    axios({
      url: "/Banner2",
      method:"get"
    })
    .then((res) => {
      this.imgs = res.data;
    });
  },
};
</script>

<style scoped>
.banner {
  width: 100%;
}
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  text-align: center;
}
.van-swipe-item > img {
  width: 100%;
}
h3{
    margin-bottom: .1rem;
    margin-left: .175rem;
}
.banner>div>img{
    width: 100%;
}
</style>